package org.foundation.jala.jamerzip.view;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class DataPanelView extends JPanel{
	private static final long serialVersionUID = 1L;
	private JTextField text;
	private JLabel tag;
	
	public DataPanelView(String toText, String toTag) {
		JPanel all = new JPanel();
		all.setAlignmentX(JPanel.LEFT_ALIGNMENT);
		tag = new JLabel(toTag);
		text = new JTextField(toText);
		text.setEditable(false);
		all.setLayout(new GridBagLayout());
		GridBagConstraints gb = new GridBagConstraints();
		gb.gridx = 0;
		gb.gridy = 0;
		gb.gridheight = 1;
		gb.gridwidth = 1;
		gb.fill = GridBagConstraints.BOTH;
		all.add(tag,gb);
		gb.gridx = 1;
		gb.gridy = 0;
		gb.gridheight = 1;
		gb.gridwidth = 3;
		gb.fill = GridBagConstraints.BOTH;
		all.add(text,gb);
		text.setPreferredSize(new Dimension(200, 40));
		text.setMinimumSize(new Dimension(200, 40));
		add(all);
	}
	
	public String getText(){
		return this.text.getText();
	}
	public void setText(String text){
		this.text.setText(text);
	}
}
